<?php
class Wmp_View_Helper_WmpSearchBox extends Zend_View
{
	public function WmpSearchBox()
    {
    	//OPTIMIZEME:trouver un meilleur moyen de recuperer l'object view et fc
    	//FIXME : utiliser zend_tranlate ...
    	$viewRenderer =  Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
		$view = $viewRenderer->view;

		$url = $view->url(array('language'=>zend_registry::get('Zend_Locale'),
								'module'=>'search',
								'controller'=>'index',
								'action'=>'index'));
    	$searchBox='
    	 	<div id="search">
             <form method="post" action="'. $url.'">
                <input type="text" name="q" value="';
    	if(array_key_exists('q', $_GET)) { 
    		$searchBox.= $this->escape($_GET['q']); 
    	} 
    	 $searchBox.='" class="input-text">
                <input type="submit" name="search" class="input-submit" value="Search">
            </form>
            </div>';
       	return $searchBox;
    }
}
